import {
  getLodop
} from "@/assets/utils/LodopFuncs";

export default function ({
  name,
  top,
  left,
  width,
  height,
  htmlContent,
  title,
  arr
}) {
  const LODOP = getLodop()
  LODOP.PRINT_INIT(name)
  LODOP.SET_PRINT_PAGESIZE(1, 0, 0, 'title')
  LODOP.SET_PRINT_STYLE('FONTSIZE', 15)
  LODOP.SET_PRINT_STYLE('BOLD', 1)
  LODOP.ADD_PRINT_HTML(50, 50, "85%", "85%", htmlContent);
  //创建表格打印 表头自动每页都有
  //   LODOP.ADD_PRINT_TABLE(40, 10, "RightMargin:0.9cm", 600, document.getElementsByClassName("printTable")[0].innerHTML);
  //创建页码 每页都有
  LODOP.ADD_PRINT_TEXT("90%", "85%", 200, 22, "第#页/共&页");
  //   LODOP.SET_PRINT_STYLE(0, "FontSize", 10);

  LODOP.ADD_PRINT_TABLE(data, format, tclass, tindex);

  LODOP.PREVIEW();
  // 显示打印设计界面，设计完毕关闭窗口后，返回生成的程序代码
  LODOP.PRINT_DESIGN();
  // 设置打印维护窗口关闭后是否返回程序代码
  LODOP.SET_PRINT_MODE("PRINT_SETUP_PROGRAM", true);
}
